package org.apache.rocketmq.store.plugin;

import org.apache.rocketmq.common.message.MessageExtBrokerInner;
import org.apache.rocketmq.store.*;
import org.apache.rocketmq.store.config.MessageStoreConfig;
import org.apache.rocketmq.store.hook.PutMessageHook;
import org.apache.rocketmq.store.hook.SendMessageBackHook;
import org.apache.rocketmq.store.logfile.MappedFile;
import org.apache.rocketmq.store.queue.ConsumeQueueInterface;
import org.apache.rocketmq.store.stats.BrokerStatsManager;
import org.rocksdb.RocksDBException;

import java.util.List;
import java.util.concurrent.CompletableFuture;


public abstract class AbstractPluginMessageStore implements MessageStore {

    protected MessageStore next = null;
    protected MessageStorePluginContext context;

    public AbstractPluginMessageStore(MessageStorePluginContext context, MessageStore next) {
        this.next = next;
        this.context = context;
    }

    @Override
    public boolean load() {
        return next.load();
    }

    @Override
    public void start() throws Exception {
        next.start();
    }

    @Override
    public void shutdown() {
        next.shutdown();
    }

    @Override
    public void destroy() {
        next.destroy();
    }

    @Override
    public long getStateMachineVersion() {
        return next.getStateMachineVersion();
    }

    @Override
    public List<PutMessageHook> getPutMessageHookList() {
        return next.getPutMessageHookList();
    }

    @Override
    public void setSendMessageBackHook(SendMessageBackHook sendMessageBackHook) {
        next.setSendMessageBackHook(sendMessageBackHook);
    }

    @Override
    public SendMessageBackHook getSendMessageBackHook() {
        return next.getSendMessageBackHook();
    }

    @Override
    public boolean isShutdown() {
        return next.isShutdown();
    }

    @Override
    public RunningFlags getRunningFlags() {
        return next.getRunningFlags();
    }

    @Override
    public BrokerStatsManager getBrokerStatsManager() {
        return next.getBrokerStatsManager();
    }

    @Override
    public boolean isOSPageCacheBusy() {
        return next.isOSPageCacheBusy();
    }

    @Override
    public MessageStoreConfig getMessageStoreConfig() {
        return next.getMessageStoreConfig();
    }

    @Override
    public CompletableFuture<PutMessageResult> asyncPutMessage(MessageExtBrokerInner msg) {
        return next.asyncPutMessage(msg);
    }

    @Override
    public PutMessageResult putMessage(MessageExtBrokerInner msg) {
        return next.putMessage(msg);
    }

    @Override
    public long dispatchBehindBytes() {
        return next.dispatchBehindBytes();
    }

    @Override
    public CommitLog getCommitLog() {
        return next.getCommitLog();
    }

    @Override
    public StoreStatsService getStoreStatsService() {
        return next.getStoreStatsService();
    }

    @Override
    public void assignOffset(MessageExtBrokerInner msg) throws RocksDBException {
        next.assignOffset(msg);
    }

    @Override
    public boolean isTransientStorePoolDeficient() {
        return next.isTransientStorePoolDeficient();
    }

    @Override
    public void onCommitLogAppend(MessageExtBrokerInner msg, AppendMessageResult result, MappedFile commitLogFile) {
        next.onCommitLogAppend(msg, result, commitLogFile);
    }

    @Override
    public void increaseOffset(MessageExtBrokerInner msg, short messageNum) {
        next.increaseOffset(msg, messageNum);
    }

    @Override
    public void unlockMappedFile(MappedFile unlockMappedFile) {
        next.unlockMappedFile(unlockMappedFile);
    }

    @Override
    public TransientStorePool getTransientStorePool() {
        return next.getTransientStorePool();
    }

    @Override
    public AllocateMappedFileService getAllocateMappedFileService() {
        return next.getAllocateMappedFileService();
    }

    @Override
    public void setConfirmOffset(long phyOffset) {
        next.setConfirmOffset(phyOffset);
    }

    @Override
    public long getMasterFlushedOffset() {
        return next.getMasterFlushedOffset();
    }

    @Override
    public void setMasterFlushedOffset(long masterFlushedOffset) {
        next.setMasterFlushedOffset(masterFlushedOffset);
    }

    @Override
    public StoreCheckpoint getStoreCheckpoint() {
        return next.getStoreCheckpoint();
    }

    @Override
    public ConsumeQueueInterface findConsumeQueue(String topic, int queueId) {
        return next.findConsumeQueue(topic, queueId);
    }

}
